<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/">
  <xi:include href="sqa_nav.html" />

  <head>
    <title>Test Plan Overview</title>
  </head>
	<script>
  		$(document).ready(function(){
    		$("#addCase").validate();
			
			
			
			
			
			
			
			
			
  		});
    </script>
  <body>


  	<h2>SQA Test Catalog </h2>
	<!-- !
	http://www.edgewall.org/docs/trac-trunk/html/api/trac_web_href.html
	>>> href('ticket', 540, 'attachment', None)
	'/trac/ticket/540/attachment'
   	-->
	<!-- TODO Add view logic-->
	
	<a href="${href.sqa('plan', show='all')}">Show All Plans</a>	
	::
	<a href="${href.sqa('plan')}">Show Enabled</a>
	
    <div id="plan" >
	
	
	<div id="plan_form" py:if="('SQA_ADMIN' in perm)">
	<!-- ! Render New Test Plan Form -->
    <form id="addCase" class="addnew" method="post" action="">
      <!-- ! Changed control mechanism to button 
	  <input type="hidden" name="sqa_control" value="add_plan" />
	  -->
      <fieldset>
        <legend>Create New Test Case</legend>
       <div>
        <div>	
          <label for="gp_subject">Test Plan Name:</label>
          <input id="gp_subject" type="text" name="plan_name"  class="required" minlength="2"  /> 
		</div>
      		<div >
      			<div>
      				<label for="action">Milestone:</label>
					<select id="action" name="test_milestone">
            			<option py:for="action in ms_list" >${action.name}</option>
          			</select>
					
      			</div>
				<div>
				
					<label for="test_type">Type:</label>
					<select id="test_type" name="test_type">
            			<option py:for="type in types">${type}</option>
          			</select>
				</div>
      		</div>
			<div>
				<fieldset>
					<legend>Test Description:</legend>
		  	 		<textarea id="c_desc" name="c_desc_ta"  class="wikitext" rows="10" cols="68"></textarea>
				</fieldset>
			</div>
		</div>		 
        <p class="help">
          Add a new test case to the testing catalog.
        </p>
        <div class="buttons">
          <py:if test="'WIKI_MODIFY' in perm">
          <!-- ! <input type="submit" name="sqa_control" value="${_('Add Test Case')}" />-->
		  <input class="submit" type="submit" name="sqa_control" value="${_('Add Test Case')}" />
		  </py:if>
		  <py:if test="'WIKI_MODIFY' not in perm">
          <!-- ! <input type="submit" name="sqa_control" value="${_('Add Test Case')}" />-->
		  <input class="submit" type="submit" name="sqa_control" disabled="true" value="${_('Login to Add Test Case')}" />
		  </py:if>
        </div>
      </fieldset>
    </form>
	
	</div>


	<!-- ! The section lists in the main window -->
	<div id="planlist">
    <form id="_caseList" method="post" py:with="revoke_perm = 'PERMISSION_REVOKE' in perm" action="">
      <table class="listing" >
        <thead>
          <tr><th style="width:20px;">Remove</th><th>Milestone</th><th>Test Case</th><th style="width:15em;">Test Case Type</th></tr>
        </thead>
        <tbody> 
		
		
		<tr py:for="plan in plans" >
        	
         		<td><input type="checkbox" name="test_case_id" value="${plan.id}"/></td>
 				<td><a href="${href.sqa('plan', milestone=plan.milestone)}"> ${plan.milestone}</a></td>
				
				<td>
				 
				 <div id="_namegrp">
			  		<label id="_namelbl"><a href="${href.sqa('case', plan.id)}"> ${plan.plan_name}</a></label>
		 		</div>
		 		<div id="_proceduregrp">
		 			<label id="_lbl">Test Case Description</label>
				</div><div>
		 			${plan.description}
		 		</div>
					

				</td>
				<td>${plan.test_type}</td>
				
        	</tr>
         
        </tbody>
      </table>
	  <!-- ! Set permissions for controls -->
      <div class="buttons" py:if="revoke_perm">
      	<!-- !REMOVE TEST CASE AND RELATED STEPS
		TODO: Define permissions for this action 
		--> 
		<!-- REQUIRES ADMIN RIGHTS -->
        <input type="submit" name="sqa_control" value="${_('Remove Test Case')}" />
		
		<!-- REQUIRES EDIT RIGHTS -->
		<input type="submit" name="sqa_control" value="${_('Disable Test Case')}" />
		
		<!-- -->
		
		<!-- ! Extra
		<input type="submit" name="sqa_control" value="${_('Remove Test Case')}" />
		-->
      </div>
    </form>
	</div>
	
	</div>

  
  

  </body>
</html>




 

